package com.dyh.quickdemozwei.forCollector;

import com.google.common.collect.Lists;

import java.util.List;
import java.util.function.Consumer;

public class RoundConsume {

    public static   <T> void pass(List<T> list, Consumer<T>... consumers){
        for (T t : list) {
            for (Consumer<T> consumer : consumers) {
                consumer.accept(t);
            }
        }
    }

    public static void main(String[] args) {
        List<Integer> list = Lists.newArrayList(1,2,3,4);

        pass(list, System.out::println,e->e++,System.out::println);


    }
}
